
\documentclass[a4paper]{article}
\usepackage{pgfplots}
\begin{document}
    \begin{tikzpicture}
        %\tracingcommands=2\tracingmacros=2
            \begin{axis}[minor ytick=data]
                \addplot {x^2};
        \end{axis}
    \end{tikzpicture}
    \begin{tikzpicture}
    %\tracingcommands=2\tracingmacros=2
        \begin{axis}[minor xtick=data]
           \addplot {x^2};
        \end{axis}
    \end{tikzpicture}
\end{document}
